<?php
/* 	These code was generated using phpCIGen v 2.a (21/05/2012)
	#zaqi 		zaqi.smart@gmail.com,http://zenzaqi.blogspot.com, 
	#CV. Trust Solution, jl. Saronojiwo 2/19 Surabaya, http://www.ts.co.id
	
	+ Module  		: t_negosiasi Print
	+ Description	: For Print View
	+ Filename 		: p_t_negosiasi.php
 	+ Author  		: zainal, son, husnu, noval
 	+ Created on 24/Jul/2012 10:52:52
	
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Seleksi</title>

<style type="text/css">
@page {
	margin-top: 5em;
	margin-left: 3em;
	margin-right: 5em;
}
table.gridtable {
	font-family: verdana,arial,sans-serif;
	font-size:11px;
	color:#333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}
table.gridtable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #dedede;
}
table.gridtable td {
	border-width: 1px;
	padding: 2px;
	border-style: solid;
	border-color: #666666;
	background-color: #ffffff;
}
</style>
</head>

<?php

	$dvo_name = '';
	$branch_name = '';
	$kcb = '';
	$project_name = '';
	$job_name = '';
	$nego_id = '';
	$m_branch_id = '';
	$t_project_id = '';
	$m_job_id = '';
	$nego_date = '';
	$nego_no = '';
	$nego_rapktotal = '';
	$nego_waktu = '';
	$nego_waktu_satuan = '';
	$nego_bayar = '';
	if($data_nego !== null || $data_nego !== ""){
		$i = 0;
		foreach($data_nego as $row_nego){
			$kcb = $row_nego->branch_kepala;
			$pm  = $row_nego->project_pm;
			$job_name = $row_nego->job_name;
			$dvo_name = $row_nego->dvo_name;
			$branch_name = $row_nego->branch_name;
			$project_name = $row_nego->project_name;
			$nego_id = $row_nego->nego_id;
			$m_branch_id = $row_nego->m_branch_id;
			$t_project_id = $row_nego->t_project_id;
			$m_job_id = $row_nego->m_job_id;
			$nego_date = $row_nego->nego_date;
			$nego_no = $row_nego->nego_no;
			$nego_rapktotal = $row_nego->nego_rapktotal;
			$nego_waktu = $row_nego->nego_waktu;
			$nego_waktu_satuan = $row_nego->nego_waktu_satuan;
			$nego_bayar = $row_nego->nego_bayar;
			$i++;
		}
	}
?>








<div>
	<table border=0 width=100%>
	<tr valign="top"><td>
	<div style="float:left; width:70%;">
		<b>PT. PP (Persero) Tbk</b><br/>
		<b>DVO :  <?php echo $dvo_name;?></b><br/>
		<b>CB :  <?php echo $branch_name;?></b><br/>
		<b>PROYEK : <?php echo $project_name;?></b><br/>
	</div>
	</td><td width="28%">
	<div style="border:1px solid #000;" align="right">
		Lampiran 2
	</div>
	</td></tr>
	</table>
</div>
<div style="clear:both;"></div>
<div align="center" style="border:1px solid #000">
	<b>SELEKSI dan NEGOSIASI PRODUSEN / KONTAK AGEN</b>  
</div>
<div align="left">
	<b>JENIS PEKERJAAN: <?php echo $job_name;?></b>  
</div>
<div align="right">
	<?php if ($data_negomenang[0]->div_name == '503. Sub Kontraktor' ){ ?>
	No. Rec. <?php echo date('m.y'); ?>/5.2/QSHE-2007/PMT/AG/W/003
	<?php }else{ ?>
	No. Rec. <?php echo date('m.y'); ?>/5.2/QSHE-2007/PMT/AG/W/004 
	<?php } ?>
</div>
<table class="gridtable" width="100%">
  <tr>
    <th rowspan="2">No.</th>
    <th rowspan="2">Kriteria</th>
    <th rowspan="2">Yang disyaratkan / RAPK</th>
    <th colspan="<?php echo sizeof($data_negodet);?>">Kemampuan yang dimiliki</th>
    <th rowspan="2">KET</th>
  </tr>
  <tr>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$b = 0;
		foreach($data_negodet as $row_negodet){
			echo "<th>" . $row_negodet->vendor_name . "</th>";
			$b++;
		}
	}			
	?>
  </tr>
  <tr>
    <td>1.</td>
    <td>Harga</td>
    <td><?php echo "Rp. " . number_format($nego_rapktotal); ?></td>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$e = 0;
		foreach($data_negodet as $row_negodet){
			echo "<td>Rp. " . number_format($row_negodet->komp_total) . "</td>";
			$e++;
		}
	}			
	?>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>2.</td>
    <td>Keahlian Personil</td>
    <td>&nbsp;</td>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$f = 0;
		foreach($data_negodet as $row_negodet){
			echo "<td>" . $row_negodet->negodet_keahlian . "</td>";
			$f++;
		}
	}			
	?>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>3.</td>
    <td>Metode Kerja (**)</td>
    <td>&nbsp;</td>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$g = 0;
		foreach($data_negodet as $row_negodet){
			echo "<td>" . $row_negodet->negodet_metode . "</td>";
			$g++;
		}
	}			
	?>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>4.</td>
    <td>Peralatan yang dipakai sesuai ketentuan K3L</td>
    <td>&nbsp;</td>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$h = 0;
		foreach($data_negodet as $row_negodet){
			echo "<td>" . $row_negodet->negodet_peralatan . "</td>";
			$h++;
		}
	}			
	?>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>5.</td>
    <td>Sanggup memenuhi persyaratan K3L</td>
    <td>&nbsp;</td>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$i = 0;
		foreach($data_negodet as $row_negodet){
			echo "<td>" . $row_negodet->negodet_k3l . "</td>";
			$i++;
		}
	}			
	?>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>6.</td>
    <td>Waktu Penyelesaian (**)</td>
    <td><?php echo $nego_waktu . " " . $nego_waktu_satuan; ?></td>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$j = 0;
		foreach($data_negodet as $row_negodet){
			echo "<td>" . $row_negodet->negodet_waktu . " " . $nego_waktu_satuan ."</td>";
			$j++;
		}
	}
	?>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>7.</td>
    <td>Cara Pembayaran</td>
    <td>&nbsp;</td>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$k = 0;
		foreach($data_negodet as $row_negodet){
			echo "<td>" . $row_negodet->payment_name . "</td>";
			$k++;
		}
	}			
	?>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>I.</b></td>
    <td colspan="2"><b>Hasil seleksi Sub-kontraktor adalah:</b></td>
    <?php
	if($data_negodet !== null || $data_negodet !== ""){
		$l = 0;
		foreach($data_negodet as $row_negodet){
			if($row_negodet->negodet_lulus == 'Y'){
				$lulus_text = 'LULUS';
			}else{
				$lulus_text = 'TIDAK LULUS';
			}
			echo "<td>" . $lulus_text . "</td>";
			$l++;
		}
	}			
	?>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><b>II.</b></td>
    <td colspan="<?php echo sizeof($data_negodet) + 3 ; ?>"><b>Keputusan Hasil Negosiasi</b><br/>
    Sub-kontraktor yang telah lulus seleksi dan dipilih adalah:<br/>
    <?php
	if($data_negomenang !== null || $data_negomenang !== ""){
		$o = 0;
		foreach($data_negomenang as $row_negomenang){
			$untung = $nego_rapktotal - $row_negomenang->komp_total;
			$persentase_untung = ( $untung / $nego_rapktotal ) * 100 ;
			echo "<b>". $row_negomenang->vendor_name . "</b><br/>";
			$o++;
		}
	}
	?>
    </td>
  </tr>
  <tr>
    <td><b>III.</b></td>
    <td colspan="<?php echo sizeof($data_negodet) + 3 ; ?>"><b>Tinjauan terhadap RAPK</b><br/>
    <?php
	if($data_negomenang !== null || $data_negomenang !== ""){
		$o = 0;
		foreach($data_negomenang as $row_negomenang){
			$untung = $nego_rapktotal - $row_negomenang->komp_total;
			$persentase_untung = ( $untung / $nego_rapktotal ) * 100 ;
			echo $row_negomenang->vendor_name . "&nbsp;|&nbsp;UNTUNG<b>&nbsp;&nbsp;Rp. " . number_format($untung, 0, ',', '.') . ",-</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>(" . number_format($persentase_untung, 2, ',', '.') . "%)</b>";
			$o++;
		}
	}
	?>
    </td>
  </tr>
</table>
<table class="gridtable" align="right">
    <tr>
        <td colspan="3">Dibuat dan diputuskan bersama:</td>
    </tr>
    <tr>
	<?php if ($data_ambang > $nego_rapktotal){ ?>
        <td align="center">KCB</td>
        <td align="center"><?php echo $procm->vvalue2; ; ?></td>
        <td align="center">PM</td>
    </tr>
    <tr>
        <td height="70px">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="center"><?php echo  $kcb; ?></td>
        <td align="center"><?php echo $procm->vvalue1; ; ?></td>
        <td align="center"><?php echo  $pm; ?></td>
    </tr>
	<?php }else{ ?>
        <td align="center"><?php echo $kdvo->vvalue2; ?></td>
        <td align="center"><?php echo $procm->vvalue2; ; ?></td>
        <td align="center">PM</td>
    </tr>
    <tr>
        <td height="70px">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td align="center"><?php echo $kdvo->vvalue1; ?></td>
        <td align="center"><?php echo $procm->vvalue1; ; ?></td>
        <td align="center"><?php echo $pm; ?></td>
    </tr>
	<?php }  ?>
</table>
<div style="clear:both;"></div>
<div>
	<table border="0" style="font-size:9px">
		<tr>
			<td width="50px">(*)</td>
			<td width="200px">Bagi kriteria / Persyaratan yang tidak ditinjau diisi:<br/><em>TIDAK DITINJAU</em></td>
		</tr>
		<tr>
			<td>(**)</td>
			<td>Kriteria minimal yang harus dipenuhi untuk lulus seleksi</td>
		</tr>
	</table>
</div>

</body>
</html>